package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysOrderMapper;
import com.ruoyi.system.domain.SysOrder;
import com.ruoyi.system.service.ISysOrderService;

/**
 * 系统订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-25
 */
@Service
public class SysOrderServiceImpl implements ISysOrderService 
{
    @Autowired
    private SysOrderMapper sysOrderMapper;

    /**
     * 查询系统订单
     * 
     * @param jobId 系统订单主键
     * @return 系统订单
     */
    @Override
    public SysOrder selectSysOrderByJobId(Long jobId)
    {
        return sysOrderMapper.selectSysOrderByJobId(jobId);
    }

    /**
     * 查询系统订单列表
     * 
     * @param sysOrder 系统订单
     * @return 系统订单
     */
    @Override
    public List<SysOrder> selectSysOrderList(SysOrder sysOrder)
    {
        return sysOrderMapper.selectSysOrderList(sysOrder);
    }

    /**
     * 新增系统订单
     * 
     * @param sysOrder 系统订单
     * @return 结果
     */
    @Override
    public int insertSysOrder(SysOrder sysOrder)
    {
        sysOrder.setCreateTime(DateUtils.getNowDate());
        return sysOrderMapper.insertSysOrder(sysOrder);
    }

    /**
     * 修改系统订单
     * 
     * @param sysOrder 系统订单
     * @return 结果
     */
    @Override
    public int updateSysOrder(SysOrder sysOrder)
    {
        sysOrder.setUpdateTime(DateUtils.getNowDate());
        return sysOrderMapper.updateSysOrder(sysOrder);
    }

    /**
     * 批量删除系统订单
     * 
     * @param jobIds 需要删除的系统订单主键
     * @return 结果
     */
    @Override
    public int deleteSysOrderByJobIds(Long[] jobIds)
    {
        return sysOrderMapper.deleteSysOrderByJobIds(jobIds);
    }

    /**
     * 删除系统订单信息
     * 
     * @param jobId 系统订单主键
     * @return 结果
     */
    @Override
    public int deleteSysOrderByJobId(Long jobId)
    {
        return sysOrderMapper.deleteSysOrderByJobId(jobId);
    }
}
